Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Device Communications Messages


GXGetDeviceStatus

QuickDraw GX sends the GXGetDeviceStatus message to query the device about its status. You can override the GXGetDeviceStatus message to send a query to your own device about its status. Your override of the GXGetDeviceStatus message must match the following formal declaration:

OSErr MyGetDeviceStatus (Ptr cmdData, long cmdSize, 
                        Ptr responseData, long *responseSize,
                        Str255 termination);
cmdData
A pointer to the status query command data.
cmdSize
The number of bytes in the command data.
responseData
On return, a pointer to the data that contains the device's response.
responseSize
On entry, the number of bytes to read. On return, the number of bytes in the response data.
termination
This is the string that marks the end of the response in the responseData parameter. If this is nil, you need to read all of the bytes in the response data.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
Before sending the GXGetDeviceStatus message yourself, you need to make sure that all pending I/O with your device is flushed. This can be done by sending a GXWriteData message with a nil pointer and a length of 0.

The default implementation of this message supports PAP, serial, and not-connected communications by writing a status request and reading back the result from the device.

SPECIAL CONSIDERATIONS
You can send the GXGetDeviceStatus message when you want to perform a status check of a device.

If you are implementing a nonsupported type of communications connection, you need to perform a total override of the GXGetDeviceStatus message. Otherwise, you need to perform your tasks and then forward the message.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
The default implementation of the GXGetDeviceStatus message can also return the communications errors that are listed in Table 4-2 on page 4-42.

SEE ALSO
The GXWriteData message is described on page 4-141.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help